
<!DOCTYPE html>
<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Hệ thống quản lí quầy thuốc online</title>
</head>
<body>
	<div id="wrapper">
		<%@ include file="../../layout/menubar.jsp"%>
		<%@ include file="../../layout/left-menu.jsp"%>
		<%@ include file="../../layout/header.jsp"%>		
        <div id="page-wrapper">
        <div class="page-content">

                <!-- begin PAGE TITLE ROW -->
                <div class="row">
                    <div class="col-lg-12">
                        <div class="page-title">
                            <ol class="breadcrumb">
                                <li><i class="fa fa-dashboard"></i>  <a href="">Quản lý thành phần</a>
                                </li>
                            </ol>
                        </div>
                    </div>
                    <!-- /.col-lg-12 -->
                </div>
                <!-- /.row -->
                <!-- end PAGE TITLE ROW -->
                <!-- begin ADVANCED TABLES ROW -->
                <div class="row">
                    <div class="col-lg-12">
                        <div class="portlet portlet-default">
                            <div class="portlet-heading">
                                <div class="portlet-title">
                                    <h4>Danh sách thành phần</h4>
                                </div>
                                <div class="clearfix"></div>
                            </div>
                            <div class="portlet-body">
                                <div class="table-responsive">
									<div class="row form-group">
										<div class="col-sm-6 col-xs-12" style="margin-top: 25px"></div>
										<div class="col-sm-6 col-xs-12">
											<form action="list">
												<input type="hidden" value="listAllData" name="listAll" />
												<button type="submit"
													class="btn btn-default pull-right btn-square">
													<span class="glyphicon glyphicon-plus"></span>&nbsp;Hiển thị tất cả
												</button>
											</form>
										</div>
										<button type="submit" style="margin: 10px 15px 10px 10px"
											class="btn btn-default pull-right btn-square"
											data-toggle="modal" data-target="#modalCreate">
											<span class="glyphicon glyphicon-plus"></span>&nbsp;Thêm mới
										</button>
									</div>
                                    <table id="example-table" class="table table-striped table-bordered table-hover table-green">
                                        <thead>
                                            <tr>
                                            	<th>STT</th>
												<th>Tên</th>
											</tr>
                                        </thead>
                                        <tbody>
                                        	<%int i = 0; %>
											<c:forEach var="gradient" items="${gradients}">
												<tr>
													<%i++; %>
													<td><%=i %></td>
													<td><a href="" data-toggle="modal"
														data-target="#modalUpdate"
														onclick="editButtonTouched(${gradient.getId()},'${gradient.getName()}')">${gradient.getName()}</a></td>
												</tr>
											</c:forEach>
										</tbody>
                                    </table>
                                </div>
                                <!-- /.table-responsive -->
                            </div>
                            <!-- /.portlet-body -->
							<div class="portlet-footer">

								<div class="clearfix"></div>
							</div>
							<!-- /.portlet-footer -->
						</div>
                        <!-- /.portlet -->
                    </div>
                    <!-- /.col-lg-12 -->
                </div>
                <!-- /.row -->
            </div>
            <!-- /.page-content -->
        </div>
        <!-- /#page-wrapper -->
        <!-- end MAIN PAGE CONTENT -->
        </div>
	<!-- Modal add user -->
	<%@ include file="create.jsp"%>
	<%@ include file="edit.jsp"%>
</body>
<script type="text/javascript">
	function editButtonTouched(id, name) {
		document.getElementById("gradientId").value = id;
	    document.getElementById("updateName").value = name;
	};
</script>
</html>
